import win32api
import win32com.client

# sleep (seconds)
sleep = lambda x: win32api.Sleep(x*1000)

skeys  = lambda x: shell.SendKeys(x)

shell = win32com.client.Dispatch("WScript.Shell")
shell.Run("notepad data.dat")
skeys("^a")
skeys("^c")
#shell.Run("scalc %s"%f)
sleep(5)

shell.Run("scalc")

sleep(5)
skeys("^v")

skeys("1{+}") # + je plus
sleep(1)
skeys("~") # ~ is the same as {ENTER}
sleep(1)

skeys("2{+}") # + je plus
sleep(1)
skeys("~") # ~ is the same as {ENTER}
sleep(1)

#shell.SendKeys("2") # 2 je dva

